/*
               File: Agencia
        Description: Agencia
             Author: GeneXus C# Generator version 10_2_1-58381
       Generated on: 9/3/2012 23:22:31.5
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class agencia : GXDataArea, System.Web.SessionState.IRequiresSessionState
   {
      protected void INITENV( )
      {
         if ( GxWebError != 0 )
         {
            return  ;
         }
      }

      protected void INITTRN( )
      {
         initialize_properties( ) ;
         entryPointCalled = false ;
         gxfirstwebparm = GetNextPar( ) ;
         gxfirstwebparm_bkp = gxfirstwebparm ;
         gxfirstwebparm = DecryptAjaxCall( gxfirstwebparm) ;
         if ( StringUtil.StrCmp(gxfirstwebparm, "dyncall") == 0 )
         {
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1 ;
               return  ;
            }
            dyncall( GetNextPar( )) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_9") == 0 )
         {
            A1PaisId = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1 ;
               return  ;
            }
            gxLoad_9( A1PaisId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxEvt") == 0 )
         {
            setAjaxEventMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1 ;
               return  ;
            }
            gxfirstwebparm = GetNextPar( ) ;
         }
         else
         {
            if ( ! IsValidAjaxCall( false) )
            {
               GxWebError = 1 ;
               return  ;
            }
            gxfirstwebparm = gxfirstwebparm_bkp ;
         }
         if ( ! entryPointCalled )
         {
            Gx_mode = gxfirstwebparm ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            if ( StringUtil.StrCmp(gxfirstwebparm, "viewer") != 0 )
            {
               AV7AgenciaId = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV7AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(AV7AgenciaId), 4, 0)));
            }
         }
         Form.Meta.addItem("Generator", "GeneXus C# 10_2_1-58381", 0) ;
         Form.Meta.addItem("Description", "Agencia", 0) ;
         context.wjLoc = "" ;
         context.nUserReturn = 0 ;
         context.wbHandled = 0 ;
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
         }
         GX_FocusControl = edtAgenciaNombre_Internalname ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         wbErr = false ;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public agencia( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default") ;
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public agencia( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default") ;
      }

      public void release( )
      {
      }

      public void execute( String aP0_Gx_mode ,
                           short aP1_AgenciaId )
      {
         this.Gx_mode = aP0_Gx_mode;
         this.AV7AgenciaId = aP1_AgenciaId;
         executePrivate();
      }

      void executePrivate( )
      {
         isStatic = false;
         webExecute();
      }

      protected override void createObjects( )
      {
      }

      public override void webExecute( )
      {
         if ( initialized == 0 )
         {
            createObjects();
            initialize();
         }
         INITENV( ) ;
         INITTRN( ) ;
         if ( ( GxWebError == 0 ) && ! isAjaxCallMode( ) )
         {
            MasterPageObj = (GXMasterPage) ClassLoader.GetInstance("appmasterpage", "GeneXus.Programs.appmasterpage", new Object[] {new GxContext( context.handle, context.DataStores, context.HttpContext)});
            MasterPageObj.setDataArea(this,false);
            MasterPageObj.webExecute();
            if ( context.isAjaxRequest( ) )
            {
               enableOutput();
               if ( ! context.isAjaxRequest( ) )
               {
                  context.GX_webresponse.AppendHeader("Cache-Control", "max-age=0");
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) )
               {
                  context.GX_webresponse.AddString((String)(context.getJSONResponse( )));
               }
               else
               {
                  if ( context.isAjaxRequest( ) )
                  {
                     disableOutput();
                  }
                  RenderHtmlHeaders( ) ;
                  context.Redirect( context.wjLoc );
                  context.DispatchAjaxCommands();
               }
            }
         }
         this.cleanup();
      }

      protected void Draw( )
      {
         if ( context.isAjaxRequest( ) )
         {
            disableOutput();
         }
         if ( ! GxWebStd.gx_redirect( context) )
         {
            disable_std_buttons( ) ;
            enableDisable( ) ;
            set_caption( ) ;
            /* Form start */
            wb_table1_2_089( true) ;
         }
         return  ;
      }

      protected void wb_table1_2_089e( bool wbgen )
      {
         if ( wbgen )
         {
         }
         /* Execute Exit event if defined. */
      }

      protected void wb_table1_2_089( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "" ;
            GxWebStd.gx_table_start( context, tblTablemain_Internalname, tblTablemain_Internalname, "", "TableBorder100x100", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table2_5_089( true) ;
         }
         return  ;
      }

      protected void wb_table2_5_089e( bool wbgen )
      {
         if ( wbgen )
         {
            /* Control Group */
            ClassString = "Group" ;
            StyleString = "" ;
            context.WriteHtmlText( "<fieldset id=\""+grpGroupdata_Internalname+"\""+" style=\"-moz-border-radius:3pt;\""+" class=\""+ClassString+"\">") ;
            context.WriteHtmlText( "<legend class=\""+ClassString+"Title"+"\">"+"Agencia"+"</legend>") ;
            wb_table3_28_089( true) ;
         }
         return  ;
      }

      protected void wb_table3_28_089e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</fieldset>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table1_2_089e( true) ;
         }
         else
         {
            wb_table1_2_089e( false) ;
         }
      }

      protected void wb_table3_28_089( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "" ;
            GxWebStd.gx_table_start( context, tblTable1_Internalname, tblTable1_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            ClassString = "ErrorViewer" ;
            StyleString = "" ;
            GxWebStd.gx_msg_list( context, "", context.GX_msglist.DisplayMode, StyleString, ClassString, "", "false");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table4_34_089( true) ;
         }
         return  ;
      }

      protected void wb_table4_34_089e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 62,'',false,'',0)\"" ;
            ClassString = "BtnEnter" ;
            StyleString = "" ;
            GxWebStd.gx_button_ctrl( context, bttBtn_enter_Internalname, "", "Confirmar", bttBtn_enter_Jsonclick, 5, "Confirmar", "", StyleString, ClassString, bttBtn_enter_Visible, 1, "standard", "EENTER.", TempTags, "", context.GetButtonType( ), "HLP_Agencia.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 63,'',false,'',0)\"" ;
            ClassString = "BtnCancel" ;
            StyleString = "" ;
            GxWebStd.gx_button_ctrl( context, bttBtn_cancel_Internalname, "", "Cancelar", bttBtn_cancel_Jsonclick, 1, "Cancelar", "", StyleString, ClassString, bttBtn_cancel_Visible, 1, "standard", "ECANCEL.", TempTags, "", context.GetButtonType( ), "HLP_Agencia.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 64,'',false,'',0)\"" ;
            ClassString = "BtnDelete" ;
            StyleString = "" ;
            GxWebStd.gx_button_ctrl( context, bttBtn_delete_Internalname, "", "Eliminar", bttBtn_delete_Jsonclick, 5, "Eliminar", "", StyleString, ClassString, bttBtn_delete_Visible, 0, "standard", "EDELETE.", TempTags, "", context.GetButtonType( ), "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table3_28_089e( true) ;
         }
         else
         {
            wb_table3_28_089e( false) ;
         }
      }

      protected void wb_table4_34_089( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "" ;
            GxWebStd.gx_table_start( context, tblTable2_Internalname, tblTable2_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock" ;
            StyleString = "" ;
            GxWebStd.gx_label_ctrl( context, lblTextblockagenciaid_Internalname, "Id", "", "", lblTextblockagenciaid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            ClassString = "Attribute" ;
            StyleString = "" ;
            GxWebStd.gx_single_line_edit( context, edtAgenciaId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A29AgenciaId), 4, 0, ",", "")), ((edtAgenciaId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A29AgenciaId), "ZZZ9")) : context.localUtil.Format( (decimal)(A29AgenciaId), "ZZZ9")), "", "", "", "", "", "", edtAgenciaId_Jsonclick, 0, ClassString, StyleString, "", 1, edtAgenciaId_Enabled, 0, "text", "", 4, "chr", 1, "row", 4, 0, 0, 0, 1, -1, true, "Id", "right", "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock" ;
            StyleString = "" ;
            GxWebStd.gx_label_ctrl( context, lblTextblockagencianombre_Internalname, "Nombre", "", "", lblTextblockagencianombre_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 44,'',false,'',0)\"" ;
            ClassString = "Attribute" ;
            StyleString = "" ;
            GxWebStd.gx_single_line_edit( context, edtAgenciaNombre_Internalname, StringUtil.RTrim( A30AgenciaNombre), StringUtil.RTrim( context.localUtil.Format( A30AgenciaNombre, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(44);\"", "", "", "", "", "", edtAgenciaNombre_Jsonclick, 0, ClassString, StyleString, "", 1, edtAgenciaNombre_Enabled, 0, "text", "", 40, "chr", 1, "row", 40, 0, 0, 0, 1, -1, true, "", "left", "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock" ;
            StyleString = "" ;
            GxWebStd.gx_label_ctrl( context, lblTextblockagencialogo_Internalname, "Logo", "", "", lblTextblockagencialogo_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            ClassString = "Image" ;
            StyleString = "" ;
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 49,'',false,'',0)\"" ;
            edtAgenciaLogo_Filetype = "tmp" ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaLogo_Internalname, "Filetype", edtAgenciaLogo_Filetype);
            if ( ! String.IsNullOrEmpty(StringUtil.RTrim( A31AgenciaLogo)) )
            {
               gxblobfileaux.Source = A31AgenciaLogo ;
               if ( ! gxblobfileaux.HasExtension() || ( StringUtil.StrCmp(edtAgenciaLogo_Filetype, "tmp") != 0 ) )
               {
                  gxblobfileaux.SetExtension(StringUtil.Trim( edtAgenciaLogo_Filetype));
               }
               if ( gxblobfileaux.ErrCode == 0 )
               {
                  A31AgenciaLogo = gxblobfileaux.GetAbsoluteName() ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31AgenciaLogo", A31AgenciaLogo);
               }
            }
            GxWebStd.gx_blob_field( context, edtAgenciaLogo_Internalname, StringUtil.RTrim( A31AgenciaLogo), context.PathToRelativeUrl( A31AgenciaLogo), (String.IsNullOrEmpty(StringUtil.RTrim( edtAgenciaLogo_Contenttype)) ? context.GetContentType( (String.IsNullOrEmpty(StringUtil.RTrim( edtAgenciaLogo_Filetype)) ? A31AgenciaLogo : edtAgenciaLogo_Filetype)) : edtAgenciaLogo_Contenttype), false, "", edtAgenciaLogo_Parameters, 0, edtAgenciaLogo_Enabled, 1, "", "", 0, -1, 250, "px", 60, "px", 0, 0, 0, edtAgenciaLogo_Jsonclick, "", StyleString, ClassString, ""+TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(49);\"", "", "", "HLP_Agencia.htm");
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaLogo_Internalname, "URL", context.PathToRelativeUrl( A31AgenciaLogo));
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock" ;
            StyleString = "" ;
            GxWebStd.gx_label_ctrl( context, lblTextblockpaisid_Internalname, "Pais Id", "", "", lblTextblockpaisid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 54,'',false,'',0)\"" ;
            ClassString = "Attribute" ;
            StyleString = "" ;
            GxWebStd.gx_single_line_edit( context, edtPaisId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A1PaisId), 4, 0, ",", "")), StringUtil.LTrim( context.localUtil.Format( (decimal)(A1PaisId), "ZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(54);\"", "", "", "", "", "", edtPaisId_Jsonclick, 0, ClassString, StyleString, "", 1, edtPaisId_Enabled, 1, "text", "", 4, "chr", 1, "row", 4, 0, 0, 0, 1, -1, true, "Id", "right", "HLP_Agencia.htm");
            /* Static images/pictures */
            ClassString = "Image" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgprompt_1_Internalname, "prompt.gif", imgprompt_1_Link, "", "", context.GetTheme( ), imgprompt_1_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 0, "", "", StyleString, ClassString, "", "", "", "''", "", 1, false, false, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock" ;
            StyleString = "" ;
            GxWebStd.gx_label_ctrl( context, lblTextblockpaisnombre_Internalname, "Pais Nombre", "", "", lblTextblockpaisnombre_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            ClassString = "Attribute" ;
            StyleString = "" ;
            GxWebStd.gx_single_line_edit( context, edtPaisNombre_Internalname, StringUtil.RTrim( A2PaisNombre), StringUtil.RTrim( context.localUtil.Format( A2PaisNombre, "")), "", "", "", "", "", "", edtPaisNombre_Jsonclick, 0, ClassString, StyleString, "", 1, edtPaisNombre_Enabled, 0, "text", "", 40, "chr", 1, "row", 40, 0, 0, 0, 1, -1, true, "", "left", "HLP_Agencia.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table4_34_089e( true) ;
         }
         else
         {
            wb_table4_34_089e( false) ;
         }
      }

      protected void wb_table2_5_089( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "" ;
            GxWebStd.gx_table_start( context, tblTabletoolbar_Internalname, tblTabletoolbar_Internalname, "", "ViewTable", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            /* Div Control */
            ClassString = "ToolbarMain" ;
            StyleString = "" ;
            GxWebStd.gx_div_start( context, divSectiontoolbar_Internalname, 1, 0, "px", 0, "px", ClassString);
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 9,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_first_Internalname, context.GetImagePath( "b9e06284-17ac-4c88-8937-5dbd84ad5d80", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_Visible, 1, "", "Primero", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_first_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 10,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_first_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_first_separator_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 11,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_previous_Internalname, context.GetImagePath( "7d212604-db7b-4785-9c0d-5faffe71aa33", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_Visible, 1, "", "Anterior", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_previous_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 12,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_previous_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_previous_separator_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 13,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_next_Internalname, context.GetImagePath( "1ae947cf-1354-41a9-8d59-d91daebf554f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_Visible, 1, "", "Siguiente", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_next_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 14,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_next_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_next_separator_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 15,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_last_Internalname, context.GetImagePath( "29211874-e613-48e5-9011-8017d984217e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_Visible, 1, "", "Ultimo", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_last_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 16,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_last_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_last_separator_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 17,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_select_Internalname, context.GetImagePath( "1ca03f75-9947-4d2c-90a4-e8ab9c5cedea", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_Visible, 1, "", "Seleccionar", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_select_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 18,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_select_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_select_separator_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 19,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_enter2_Internalname, context.GetImagePath( "2061cf2c-bd33-4433-a13e-34af954142e9", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_Visible, imgBtn_enter2_Enabled, "", "Confirmar", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_enter2_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 20,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_enter2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_enter2_separator_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 21,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_Internalname, context.GetImagePath( "0e94ced8-bc34-47ff-9a53-bc683736a686", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_Visible, 1, "", "Cancelar", 0, 0, 0, "", 0, "", 0, 0, 1, imgBtn_cancel2_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 22,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 1, imgBtn_cancel2_separator_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 23,'',false,'',0)\"" ;
            ClassString = "ImageHandCenter" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_delete2_Internalname, context.GetImagePath( "7695fe89-52c9-4b7e-871e-0e11548f823e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_Visible, imgBtn_delete2_Enabled, "", "Eliminar", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_delete2_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 24,'',false,'',0)\"" ;
            ClassString = "ImageTop" ;
            StyleString = "" ;
            GxWebStd.gx_bitmap( context, imgBtn_delete2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_separator_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 5, imgBtn_delete2_separator_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Agencia.htm");
            context.WriteHtmlText( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table2_5_089e( true) ;
         }
         else
         {
            wb_table2_5_089e( false) ;
         }
      }

      protected void UserMain( )
      {
         standaloneStartup( ) ;
      }

      protected void standaloneStartup( )
      {
         standaloneStartupServer( ) ;
         disable_std_buttons( ) ;
         enableDisable( ) ;
         Process( ) ;
      }

      protected void standaloneStartupServer( )
      {
         /* Execute Start event if defined. */
         context.wbGlbDoneStart = 0 ;
         /* Execute user event: E11082 */
         E11082 ();
         context.wbGlbDoneStart = 1 ;
         assign_properties_default( ) ;
         if ( AnyError == 0 )
         {
            if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
            {
               /* Read saved SDTs. */
               /* Read variables values. */
               A29AgenciaId = (short)(context.localUtil.CToN( cgiGet( edtAgenciaId_Internalname), ",", ".")) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
               A30AgenciaNombre = cgiGet( edtAgenciaNombre_Internalname) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AgenciaNombre", A30AgenciaNombre);
               A31AgenciaLogo = cgiGet( edtAgenciaLogo_Internalname) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31AgenciaLogo", A31AgenciaLogo);
               if ( ( ( context.localUtil.CToN( cgiGet( edtPaisId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPaisId_Internalname), ",", ".") > Convert.ToDecimal( 9999 )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PAISID");
                  AnyError = 1 ;
                  GX_FocusControl = edtPaisId_Internalname ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true ;
                  A1PaisId = 0 ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
               }
               else
               {
                  A1PaisId = (short)(context.localUtil.CToN( cgiGet( edtPaisId_Internalname), ",", ".")) ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
               }
               A2PaisNombre = cgiGet( edtPaisNombre_Internalname) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
               /* Read saved values. */
               Z29AgenciaId = (short)(context.localUtil.CToN( cgiGet( "Z29AgenciaId"), ",", ".")) ;
               Z30AgenciaNombre = cgiGet( "Z30AgenciaNombre") ;
               Z1PaisId = (short)(context.localUtil.CToN( cgiGet( "Z1PaisId"), ",", ".")) ;
               IsConfirmed = (short)(context.localUtil.CToN( cgiGet( "IsConfirmed"), ",", ".")) ;
               IsModified = (short)(context.localUtil.CToN( cgiGet( "IsModified"), ",", ".")) ;
               Gx_mode = cgiGet( "Mode") ;
               N1PaisId = (short)(context.localUtil.CToN( cgiGet( "N1PaisId"), ",", ".")) ;
               AV7AgenciaId = (short)(context.localUtil.CToN( cgiGet( "vAGENCIAID"), ",", ".")) ;
               AV12Insert_PaisId = (short)(context.localUtil.CToN( cgiGet( "vINSERT_PAISID"), ",", ".")) ;
               AV15Pgmname = cgiGet( "vPGMNAME") ;
               Gx_mode = cgiGet( "vMODE") ;
               edtAgenciaLogo_Filename = cgiGet( "AGENCIALOGO_Filename") ;
               edtAgenciaLogo_Filetype = cgiGet( "AGENCIALOGO_Filetype") ;
               /* Read subfile selected row values. */
               /* Read hidden variables. */
               if ( ! String.IsNullOrEmpty(StringUtil.RTrim( A31AgenciaLogo)) )
               {
                  edtAgenciaLogo_Filename = (String)(CGIGetFileName(edtAgenciaLogo_Internalname)) ;
                  edtAgenciaLogo_Filetype = (String)(CGIGetFileType(edtAgenciaLogo_Internalname)) ;
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( A31AgenciaLogo)) )
               {
                  A31AgenciaLogo = cgiGet( "gxBlobAGENCIALOGO") ;
               }
               standaloneNotModal( ) ;
            }
            else
            {
               standaloneNotModal( ) ;
               if ( StringUtil.StrCmp(gxfirstwebparm, "viewer") == 0 )
               {
                  Gx_mode = "DSP" ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  A29AgenciaId = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
                  getEqualNoModal( ) ;
                  Gx_mode = "DSP" ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  disable_std_buttons( ) ;
                  standaloneModal( ) ;
               }
               else
               {
                  if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
                  {
                     sMode9 = Gx_mode ;
                     Gx_mode = "UPD" ;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     Gx_mode = sMode9 ;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  }
                  standaloneModal( ) ;
                  if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
                  {
                     getByPrimaryKey( ) ;
                     if ( RcdFound9 == 1 )
                     {
                        if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
                        {
                           /* Confirm record */
                           CONFIRM_080( ) ;
                           if ( AnyError == 0 )
                           {
                              GX_FocusControl = bttBtn_enter_Internalname ;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                           }
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noinsert", ""), 1, "AGENCIAID");
                        AnyError = 1 ;
                     }
                  }
               }
            }
         }
      }

      protected void Process( )
      {
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            /* Read Transaction buttons. */
            sEvt = cgiGet( "_EventName") ;
            EvtGridId = cgiGet( "_EventGridId") ;
            EvtRowId = cgiGet( "_EventRowId") ;
            if ( StringUtil.Len( sEvt) > 0 )
            {
               sEvtType = StringUtil.Left( sEvt, 1) ;
               sEvt = StringUtil.Right( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
               if ( StringUtil.StrCmp(sEvtType, "M") != 0 )
               {
                  if ( StringUtil.StrCmp(sEvtType, "E") == 0 )
                  {
                     sEvtType = StringUtil.Right( sEvt, 1) ;
                     if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                     {
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
                        if ( StringUtil.StrCmp(sEvt, "START") == 0 )
                        {
                           context.wbHandled = 1 ;
                           dynload_actions( ) ;
                           /* Execute user event: E11082 */
                           E11082 ();
                        }
                        else if ( StringUtil.StrCmp(sEvt, "AFTER TRN") == 0 )
                        {
                           context.wbHandled = 1 ;
                           dynload_actions( ) ;
                           /* Execute user event: E12082 */
                           E12082 ();
                        }
                        else if ( StringUtil.StrCmp(sEvt, "ENTER") == 0 )
                        {
                           context.wbHandled = 1 ;
                           if ( StringUtil.StrCmp(Gx_mode, "DSP") != 0 )
                           {
                              btn_enter( ) ;
                           }
                           /* No code required for Cancel button. It is implemented as the Reset button. */
                        }
                        else if ( StringUtil.StrCmp(sEvt, "FIRST") == 0 )
                        {
                           context.wbHandled = 1 ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "PREVIOUS") == 0 )
                        {
                           context.wbHandled = 1 ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "NEXT") == 0 )
                        {
                           context.wbHandled = 1 ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LAST") == 0 )
                        {
                           context.wbHandled = 1 ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "SELECT") == 0 )
                        {
                           context.wbHandled = 1 ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "DELETE") == 0 )
                        {
                           context.wbHandled = 1 ;
                           if ( StringUtil.StrCmp(Gx_mode, "DSP") != 0 )
                           {
                              btn_delete( ) ;
                           }
                        }
                     }
                     else
                     {
                     }
                  }
                  context.wbHandled = 1 ;
               }
            }
         }
      }

      protected void AfterTrn( )
      {
         if ( trnEnded == 1 )
         {
            /* Execute user event: E12082 */
            E12082 ();
            trnEnded = 0 ;
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               /* Clear variables for new insertion. */
               InitAll089( ) ;
               standaloneNotModal( ) ;
               standaloneModal( ) ;
            }
         }
      }

      public override String ToString( )
      {
         return "" ;
      }

      public GxContentInfo GetContentInfo( )
      {
         return (GxContentInfo)(null) ;
      }

      protected void disable_std_buttons( )
      {
         imgBtn_delete2_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         imgBtn_first_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_Visible), 5, 0)));
         imgBtn_first_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_separator_Visible), 5, 0)));
         imgBtn_previous_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_Visible), 5, 0)));
         imgBtn_previous_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_separator_Visible), 5, 0)));
         imgBtn_next_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_Visible), 5, 0)));
         imgBtn_next_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_separator_Visible), 5, 0)));
         imgBtn_last_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_Visible), 5, 0)));
         imgBtn_last_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_separator_Visible), 5, 0)));
         imgBtn_select_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_Visible), 5, 0)));
         imgBtn_select_separator_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_separator_Visible), 5, 0)));
         if ( ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
         {
            imgBtn_delete2_Visible = 0 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
            imgBtn_delete2_separator_Visible = 0 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
            bttBtn_delete_Visible = 0 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
            if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
            {
               imgBtn_enter2_Visible = 0 ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Visible), 5, 0)));
               imgBtn_enter2_separator_Visible = 0 ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_separator_Visible), 5, 0)));
               bttBtn_enter_Visible = 0 ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_enter_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_enter_Visible), 5, 0)));
            }
            DisableAttributes089( ) ;
         }
      }

      protected void set_caption( )
      {
         if ( ( IsConfirmed == 1 ) && ( AnyError == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_confdelete", ""), 0, "");
            }
            else
            {
               GX_msglist.addItem(context.GetMessage( "GXM_mustconfirm", ""), 0, "");
            }
         }
      }

      protected void CONFIRM_080( )
      {
         BeforeValidate089( ) ;
         if ( AnyError == 0 )
         {
            if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               OnDeleteControls089( ) ;
            }
            else
            {
               CheckExtendedTable089( ) ;
               CloseExtendedTableCursors089( ) ;
            }
         }
         if ( AnyError == 0 )
         {
            IsConfirmed = 1 ;
         }
      }

      protected void ResetCaption080( )
      {
      }

      protected void E11082( )
      {
         /* Start Routine */
         new isauthorized(context ).execute(  AV15Pgmname, out  AV9IsAuthorized) ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV15Pgmname", AV15Pgmname);
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV9IsAuthorized", StringUtil.BoolToStr( AV9IsAuthorized));
         if ( ! AV9IsAuthorized )
         {
            context.wjLoc = formatLink("notauthorized.aspx") + "?" + UrlEncode(StringUtil.RTrim(AV15Pgmname)) ;
         }
         AV10TrnContext.FromXml(AV11WebSession.Get("TrnContext"), "");
         AV12Insert_PaisId = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV12Insert_PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(AV12Insert_PaisId), 4, 0)));
         if ( ( StringUtil.StrCmp(AV10TrnContext.gxTpr_Transactionname, AV15Pgmname) == 0 ) && ( StringUtil.StrCmp(Gx_mode, "INS") == 0 ) )
         {
            AV16GXV1 = 1 ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV16GXV1", StringUtil.LTrim( StringUtil.Str( (decimal)(AV16GXV1), 8, 0)));
            while ( AV16GXV1 <= AV10TrnContext.gxTpr_Attributes.Count )
            {
               AV13TrnContextAtt = ((SdtTransactionContext_Attribute)AV10TrnContext.gxTpr_Attributes.Item(AV16GXV1)) ;
               if ( StringUtil.StrCmp(AV13TrnContextAtt.gxTpr_Attributename, "PaisId") == 0 )
               {
                  AV12Insert_PaisId = (short)(NumberUtil.Val( AV13TrnContextAtt.gxTpr_Attributevalue, ".")) ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV12Insert_PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(AV12Insert_PaisId), 4, 0)));
               }
               AV16GXV1 = (int)(AV16GXV1+1) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV16GXV1", StringUtil.LTrim( StringUtil.Str( (decimal)(AV16GXV1), 8, 0)));
            }
         }
      }

      protected void E12082( )
      {
         /* After Trn Routine */
         if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) && ! AV10TrnContext.gxTpr_Callerondelete )
         {
            context.wjLoc = formatLink("wwagencia.aspx")  ;
         }
         context.setWebReturnParms(new Object[] {});
         context.nUserReturn = 1 ;
         returnInSub = true;
         if (true) return;
      }

      protected void ZM089( short GX_JID )
      {
         if ( ( GX_JID == 8 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z30AgenciaNombre = T00083_A30AgenciaNombre[0] ;
               Z1PaisId = T00083_A1PaisId[0] ;
            }
            else
            {
               Z30AgenciaNombre = A30AgenciaNombre ;
               Z1PaisId = A1PaisId ;
            }
         }
         if ( GX_JID == -8 )
         {
            Z29AgenciaId = A29AgenciaId ;
            Z30AgenciaNombre = A30AgenciaNombre ;
            Z31AgenciaLogo = A31AgenciaLogo ;
            Z1PaisId = A1PaisId ;
            Z2PaisNombre = A2PaisNombre ;
         }
      }

      protected void standaloneNotModal( )
      {
         edtAgenciaId_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtAgenciaId_Enabled), 5, 0)));
         imgprompt_1_Link = ((StringUtil.StrCmp(Gx_mode, "DSP")==0) ? "" : "javascript:"+"gx.popup.openPrompt('"+"gx0010.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PAISID"+"'), id:'"+"PAISID"+"'"+",isOut: true}"+"],"+"null"+","+"'', false"+","+"false"+");") ;
         edtAgenciaId_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtAgenciaId_Enabled), 5, 0)));
         imgBtn_delete2_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         if ( ! (0==AV7AgenciaId) )
         {
            A29AgenciaId = AV7AgenciaId ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
         }
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 ) && ! (0==AV12Insert_PaisId) )
         {
            edtPaisId_Enabled = 0 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPaisId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPaisId_Enabled), 5, 0)));
         }
         else
         {
            edtPaisId_Enabled = 1 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPaisId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPaisId_Enabled), 5, 0)));
         }
      }

      protected void standaloneModal( )
      {
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 ) && ! (0==AV12Insert_PaisId) )
         {
            A1PaisId = AV12Insert_PaisId ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
         }
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Enabled = 0 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_enter2_Enabled = 1 ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 ) && ( Gx_BScreen == 0 ) )
         {
            AV15Pgmname = "Agencia" ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV15Pgmname", AV15Pgmname);
            /* Using cursor T00084 */
            pr_default.execute(2, new Object[] {A1PaisId});
            A2PaisNombre = T00084_A2PaisNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
            pr_default.close(2);
         }
      }

      protected void Load089( )
      {
         /* Using cursor T00085 */
         pr_default.execute(3, new Object[] {A29AgenciaId});
         if ( (pr_default.getStatus(3) != 101) )
         {
            RcdFound9 = 1 ;
            A30AgenciaNombre = T00085_A30AgenciaNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AgenciaNombre", A30AgenciaNombre);
            A2PaisNombre = T00085_A2PaisNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
            A1PaisId = T00085_A1PaisId[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
            A31AgenciaLogo = T00085_A31AgenciaLogo[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31AgenciaLogo", A31AgenciaLogo);
            ZM089( -8) ;
         }
         pr_default.close(3);
         OnLoadActions089( ) ;
      }

      protected void OnLoadActions089( )
      {
         AV15Pgmname = "Agencia" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV15Pgmname", AV15Pgmname);
      }

      protected void CheckExtendedTable089( )
      {
         Gx_BScreen = 1 ;
         standaloneModal( ) ;
         AV15Pgmname = "Agencia" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV15Pgmname", AV15Pgmname);
         /* Using cursor T00084 */
         pr_default.execute(2, new Object[] {A1PaisId});
         if ( (pr_default.getStatus(2) == 101) )
         {
            AnyError1 = 1 ;
            GX_msglist.addItem("No existe 'Pais'.", "ForeignKeyNotFound", 1, "PAISID");
            AnyError = 1 ;
            GX_FocusControl = edtPaisId_Internalname ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError1 == 0 )
         {
            A2PaisNombre = T00084_A2PaisNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
         }
         pr_default.close(2);
      }

      protected void CloseExtendedTableCursors089( )
      {
         pr_default.close(2);
      }

      protected void enableDisable( )
      {
      }

      protected void gxLoad_9( short A1PaisId )
      {
         /* Using cursor T00086 */
         pr_default.execute(4, new Object[] {A1PaisId});
         if ( (pr_default.getStatus(4) == 101) )
         {
            AnyError1 = 1 ;
            GX_msglist.addItem("No existe 'Pais'.", "ForeignKeyNotFound", 1, "PAISID");
            AnyError = 1 ;
            GX_FocusControl = edtPaisId_Internalname ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError1 == 0 )
         {
            A2PaisNombre = T00086_A2PaisNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("\""+GXUtil.EncodeJSConstant( StringUtil.RTrim( A2PaisNombre))+"\"");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(4) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(4);
      }

      protected void GetKey089( )
      {
         /* Using cursor T00087 */
         pr_default.execute(5, new Object[] {A29AgenciaId});
         if ( (pr_default.getStatus(5) != 101) )
         {
            RcdFound9 = 1 ;
         }
         else
         {
            RcdFound9 = 0 ;
         }
         pr_default.close(5);
      }

      protected void getByPrimaryKey( )
      {
         /* Using cursor T00083 */
         pr_default.execute(1, new Object[] {A29AgenciaId});
         if ( (pr_default.getStatus(1) != 101) )
         {
            ZM089( 8) ;
            RcdFound9 = 1 ;
            A29AgenciaId = T00083_A29AgenciaId[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
            A30AgenciaNombre = T00083_A30AgenciaNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AgenciaNombre", A30AgenciaNombre);
            A1PaisId = T00083_A1PaisId[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
            A31AgenciaLogo = T00083_A31AgenciaLogo[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31AgenciaLogo", A31AgenciaLogo);
            Z29AgenciaId = A29AgenciaId ;
            sMode9 = Gx_mode ;
            Gx_mode = "" ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            Load089( ) ;
            Gx_mode = sMode9 ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound9 = 0 ;
            InitializeNonKey089( ) ;
            sMode9 = Gx_mode ;
            Gx_mode = "" ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Gx_mode = sMode9 ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         pr_default.close(1);
      }

      protected void getEqualNoModal( )
      {
         GetKey089( ) ;
         if ( RcdFound9 == 0 )
         {
         }
         else
         {
         }
         getByPrimaryKey( ) ;
      }

      protected void move_next( )
      {
         RcdFound9 = 0 ;
         /* Using cursor T00088 */
         pr_default.execute(6, new Object[] {A29AgenciaId});
         if ( (pr_default.getStatus(6) != 101) )
         {
            while ( (pr_default.getStatus(6) != 101) && ( ( T00088_A29AgenciaId[0] < A29AgenciaId ) ) )
            {
               pr_default.readNext(6);
            }
            if ( (pr_default.getStatus(6) != 101) && ( ( T00088_A29AgenciaId[0] > A29AgenciaId ) ) )
            {
               A29AgenciaId = T00088_A29AgenciaId[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
               RcdFound9 = 1 ;
            }
         }
         pr_default.close(1);
      }

      protected void move_previous( )
      {
         RcdFound9 = 0 ;
         /* Using cursor T00089 */
         pr_default.execute(7, new Object[] {A29AgenciaId});
         if ( (pr_default.getStatus(7) != 101) )
         {
            while ( (pr_default.getStatus(7) != 101) && ( ( T00089_A29AgenciaId[0] > A29AgenciaId ) ) )
            {
               pr_default.readNext(7);
            }
            if ( (pr_default.getStatus(7) != 101) && ( ( T00089_A29AgenciaId[0] < A29AgenciaId ) ) )
            {
               A29AgenciaId = T00089_A29AgenciaId[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
               RcdFound9 = 1 ;
            }
         }
         pr_default.close(0);
      }

      protected void btn_enter( )
      {
         nKeyPressed = 1 ;
         GetKey089( ) ;
         if ( RcdFound9 == 1 )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "AGENCIAID");
               AnyError = 1 ;
            }
            else if ( A29AgenciaId != Z29AgenciaId )
            {
               A29AgenciaId = Z29AgenciaId ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
               GX_msglist.addItem(context.GetMessage( "GXM_getbeforeupd", ""), "CandidateKeyNotFound", 1, "AGENCIAID");
               AnyError = 1 ;
            }
            else if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               delete( ) ;
               AfterTrn( ) ;
               GX_FocusControl = edtAgenciaNombre_Internalname ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else
            {
               /* Update record */
               Update089( ) ;
               GX_FocusControl = edtAgenciaNombre_Internalname ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
         }
         else
         {
            if ( A29AgenciaId != Z29AgenciaId )
            {
               /* Insert record */
               GX_FocusControl = edtAgenciaNombre_Internalname ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               Insert089( ) ;
               if ( AnyError == 1 )
               {
                  GX_FocusControl = "" ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
            }
            else
            {
               if ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "AGENCIAID");
                  AnyError = 1 ;
               }
               else
               {
                  /* Insert record */
                  GX_FocusControl = edtAgenciaNombre_Internalname ;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  Insert089( ) ;
                  if ( AnyError == 1 )
                  {
                     GX_FocusControl = "" ;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
            }
         }
         AfterTrn( ) ;
         if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
         {
            if ( AnyError == 0 )
            {
               context.nUserReturn = 1 ;
            }
         }
      }

      protected void btn_delete( )
      {
         if ( A29AgenciaId != Z29AgenciaId )
         {
            A29AgenciaId = Z29AgenciaId ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
            GX_msglist.addItem(context.GetMessage( "GXM_getbeforedlt", ""), 1, "AGENCIAID");
            AnyError = 1 ;
         }
         else
         {
            delete( ) ;
            AfterTrn( ) ;
            GX_FocusControl = edtAgenciaNombre_Internalname ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError != 0 )
         {
         }
      }

      protected void CheckOptimisticConcurrency089( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T000810 */
            pr_default.execute(8, new Object[] {A29AgenciaId});
            if ( (pr_default.getStatus(8) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Agencia"}), "RecordIsLocked", 1, "");
               AnyError = 1 ;
               return  ;
            }
            if ( (pr_default.getStatus(8) == 101) || ( StringUtil.StrCmp(Z30AgenciaNombre, T000810_A30AgenciaNombre[0]) != 0 ) || ( Z1PaisId != T000810_A1PaisId[0] ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"Agencia"}), "RecordWasChanged", 1, "");
               AnyError = 1 ;
               return  ;
            }
         }
      }

      protected void Insert089( )
      {
         BeforeValidate089( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable089( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM089( 0) ;
            CheckOptimisticConcurrency089( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm089( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert089( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000811 */
                     pr_default.execute(9, new Object[] {A30AgenciaNombre, A31AgenciaLogo, A1PaisId});
                     pr_default.close(9);
                     /* Retrieving last key number assigned */
                     /* Using cursor T000812 */
                     pr_default.execute(10);
                     A29AgenciaId = T000812_A29AgenciaId[0] ;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
                     pr_default.close(10);
                     dsDefault.SmartCacheProvider.SetUpdated("Agencia") ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           /* Save values for previous() function. */
                           GX_msglist.addItem(context.GetMessage( "GXM_sucadded", ""), 0, "");
                           ResetCaption080( ) ;
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1 ;
                  }
               }
            }
            else
            {
               Load089( ) ;
            }
            EndLevel089( ) ;
         }
         CloseExtendedTableCursors089( ) ;
      }

      protected void Update089( )
      {
         BeforeValidate089( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable089( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency089( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm089( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate089( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000813 */
                     pr_default.execute(11, new Object[] {A30AgenciaNombre, A1PaisId, A29AgenciaId});
                     pr_default.close(11);
                     dsDefault.SmartCacheProvider.SetUpdated("Agencia") ;
                     if ( (pr_default.getStatus(11) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Agencia"}), "RecordIsLocked", 1, "");
                        AnyError = 1 ;
                     }
                     DeferredUpdate089( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
                           {
                              if ( AnyError == 0 )
                              {
                                 context.nUserReturn = 1 ;
                              }
                           }
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1 ;
                     }
                  }
               }
            }
            EndLevel089( ) ;
         }
         CloseExtendedTableCursors089( ) ;
      }

      protected void DeferredUpdate089( )
      {
         if ( AnyError == 0 )
         {
            /* Using cursor T000814 */
            pr_default.execute(12, new Object[] {A31AgenciaLogo, A29AgenciaId});
            pr_default.close(12);
            dsDefault.SmartCacheProvider.SetUpdated("Agencia") ;
         }
      }

      protected void delete( )
      {
         BeforeValidate089( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency089( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls089( ) ;
            AfterConfirm089( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete089( ) ;
               if ( AnyError == 0 )
               {
                  /* No cascading delete specified. */
                  /* Using cursor T000815 */
                  pr_default.execute(13, new Object[] {A29AgenciaId});
                  pr_default.close(13);
                  dsDefault.SmartCacheProvider.SetUpdated("Agencia") ;
                  if ( AnyError == 0 )
                  {
                     /* Start of After( delete) rules */
                     /* End of After( delete) rules */
                     if ( AnyError == 0 )
                     {
                        if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
                        {
                           if ( AnyError == 0 )
                           {
                              context.nUserReturn = 1 ;
                           }
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1 ;
                  }
               }
            }
         }
         sMode9 = Gx_mode ;
         Gx_mode = "DLT" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel089( ) ;
         Gx_mode = sMode9 ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls089( )
      {
         standaloneModal( ) ;
         if ( AnyError == 0 )
         {
            /* Delete mode formulas */
            AV15Pgmname = "Agencia" ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "AV15Pgmname", AV15Pgmname);
            /* Using cursor T000816 */
            pr_default.execute(14, new Object[] {A1PaisId});
            A2PaisNombre = T000816_A2PaisNombre[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
            pr_default.close(14);
         }
         if ( AnyError == 0 )
         {
            /* Using cursor T000817 */
            pr_default.execute(15, new Object[] {A29AgenciaId});
            if ( (pr_default.getStatus(15) != 101) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_del", new   object[]  {"Noticia"}), "CannotDeleteReferencedRecord", 1, "");
               AnyError = 1 ;
            }
            pr_default.close(15);
         }
      }

      protected void EndLevel089( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(8);
         }
         if ( AnyError == 0 )
         {
            BeforeComplete089( ) ;
         }
         if ( AnyError == 0 )
         {
            pr_default.close(7);
            pr_default.close(6);
            pr_default.close(14);
            context.CommitDataStores("Agencia");
            if ( AnyError == 0 )
            {
               ConfirmValues080( ) ;
            }
            /* After transaction rules */
            /* Execute 'After Trn' event if defined. */
            trnEnded = 1 ;
         }
         else
         {
            pr_default.close(7);
            pr_default.close(6);
            pr_default.close(14);
            context.RollbackDataStores("Agencia");
         }
         IsModified = 0 ;
         if ( AnyError != 0 )
         {
            context.wjLoc = "" ;
            context.nUserReturn = 0 ;
         }
      }

      public void ScanStart089( )
      {
         /* Scan By routine */
         /* Using cursor T000818 */
         pr_default.execute(16);
         RcdFound9 = 0 ;
         if ( (pr_default.getStatus(16) != 101) )
         {
            RcdFound9 = 1 ;
            A29AgenciaId = T000818_A29AgenciaId[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext089( )
      {
         /* Scan next routine */
         pr_default.readNext(16);
         RcdFound9 = 0 ;
         if ( (pr_default.getStatus(16) != 101) )
         {
            RcdFound9 = 1 ;
            A29AgenciaId = T000818_A29AgenciaId[0] ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
         }
      }

      protected void ScanEnd089( )
      {
      }

      protected void AfterConfirm089( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert089( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate089( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete089( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete089( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate089( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes089( )
      {
         edtAgenciaId_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtAgenciaId_Enabled), 5, 0)));
         edtAgenciaNombre_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaNombre_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtAgenciaNombre_Enabled), 5, 0)));
         edtAgenciaLogo_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtAgenciaLogo_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtAgenciaLogo_Enabled), 5, 0)));
         edtPaisId_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPaisId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPaisId_Enabled), 5, 0)));
         edtPaisNombre_Enabled = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPaisNombre_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPaisNombre_Enabled), 5, 0)));
      }

      protected void assign_properties_default( )
      {
      }

      protected void ConfirmValues080( )
      {
      }

      public override void RenderHtmlHeaders( )
      {
         GxWebStd.gx_html_headers( context, 0, "", "", Form.Meta, Form.Metaequiv, "IE=EmulateIE7");
      }

      public override void RenderHtmlOpenForm( )
      {
         context.WriteHtmlText( "<title>") ;
         context.WriteHtmlText( Form.Caption) ;
         context.WriteHtmlTextNl( "</title>") ;
         if ( StringUtil.Len( sDynURL) > 0 )
         {
            context.WriteHtmlText( "<BASE href=\""+sDynURL+"\" />") ;
         }
         define_styles( ) ;
         MasterPageObj.master_styles();
         if ( ! context.isSmartDevice( ) )
         {
            context.AddJavascriptSource("gxgral.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 58381));
         }
         else
         {
            context.AddJavascriptSource("gxapiSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxfxSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxtypesSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxpopupSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxfrmutlSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxgridSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("JavaScripTableSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("rijndaelSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxgralSD.js", "?"+context.GetBuildNumber( 58381));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 58381));
         }
         context.WriteHtmlText( Form.Headerrawhtml) ;
         context.CloseHtmlHeader();
         FormProcess = " onkeyup=\"gx.evt.onkeyup(event)\" onkeypress=\"gx.evt.onkeypress(event,true,false)\" onkeydown=\"gx.evt.onkeypress(null,true,false)\"" ;
         context.WriteHtmlText( "<body") ;
         context.WriteHtmlText( " "+"class=\"Form\""+" "+" style=\"-moz-opacity:0;opacity:0;"+"background-color:"+context.BuildHTMLColor( Form.Backcolor)+";") ;
         if ( ! ( String.IsNullOrEmpty(StringUtil.RTrim( Form.Background)) ) )
         {
            context.WriteHtmlText( " background-image:url("+context.convertURL( Form.Background)+")") ;
         }
         context.WriteHtmlText( "\""+FormProcess+">") ;
         context.skipLines(1);
         context.WriteHtmlTextNl( "<form id=\"MAINFORM\" onsubmit=\"try{return gx.csv.validForm()}catch(e){return true;}\" name=\"MAINFORM\" method=\"post\" class=\"Form\" novalidate action=\""+formatLink("agencia.aspx") + "?" + UrlEncode(StringUtil.RTrim(Gx_mode)) + "," + UrlEncode("" +AV7AgenciaId)+"\">") ;
         GxWebStd.gx_hidden_field( context, "_EventName", "");
         GxWebStd.gx_hidden_field( context, "_EventGridId", "");
         GxWebStd.gx_hidden_field( context, "_EventRowId", "");
      }

      public override void RenderHtmlCloseForm( )
      {
         /* Send hidden variables. */
         /* Send saved values. */
         GxWebStd.gx_hidden_field( context, "Z29AgenciaId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z29AgenciaId), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z30AgenciaNombre", StringUtil.RTrim( Z30AgenciaNombre));
         GxWebStd.gx_hidden_field( context, "Z1PaisId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z1PaisId), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsConfirmed", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsConfirmed), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsModified", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsModified), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Mode", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "N1PaisId", StringUtil.LTrim( StringUtil.NToC( (decimal)(A1PaisId), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vAGENCIAID", StringUtil.LTrim( StringUtil.NToC( (decimal)(AV7AgenciaId), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vINSERT_PAISID", StringUtil.LTrim( StringUtil.NToC( (decimal)(AV12Insert_PaisId), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vPGMNAME", StringUtil.RTrim( AV15Pgmname));
         GxWebStd.gx_hidden_field( context, "vMODE", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "gxBlobAGENCIALOGO", StringUtil.RTrim( A31AgenciaLogo));
         GxWebStd.gx_hidden_field( context, "AGENCIALOGO_Filename", StringUtil.RTrim( edtAgenciaLogo_Filename));
         GxWebStd.gx_hidden_field( context, "AGENCIALOGO_Filetype", StringUtil.RTrim( edtAgenciaLogo_Filetype));
         GxWebStd.gx_hidden_field( context, "GX_FocusControl", GX_FocusControl);
         SendAjaxEncryptionKey();
         SendComponentObjects();
         SendServerCommands();
         SendState();
         context.WriteHtmlTextNl( "</form>") ;
         include_jscripts( ) ;
      }

      public override short ExecuteStartEvent( )
      {
         standaloneStartup( ) ;
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0)) ;
         return gxajaxcallmode ;
      }

      public override void RenderHtmlContent( )
      {
         Draw( ) ;
      }

      public override void DispatchEvents( )
      {
         Process( ) ;
      }

      public override bool HasEnterEvent( )
      {
         return true ;
      }

      public override String GetPgmname( )
      {
         return "Agencia" ;
      }

      public override String GetPgmdesc( )
      {
         return "Agencia" ;
      }

      public override GXWebForm GetForm( )
      {
         return Form ;
      }

      public override String GetSelfLink( )
      {
         return formatLink("agencia.aspx") + "?" + UrlEncode(StringUtil.RTrim(Gx_mode)) + "," + UrlEncode("" +AV7AgenciaId) ;
      }

      protected void InitializeNonKey089( )
      {
         A1PaisId = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PaisId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PaisId), 4, 0)));
         A30AgenciaNombre = "" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AgenciaNombre", A30AgenciaNombre);
         A31AgenciaLogo = "" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31AgenciaLogo", A31AgenciaLogo);
         A2PaisNombre = "" ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2PaisNombre", A2PaisNombre);
      }

      protected void InitAll089( )
      {
         A29AgenciaId = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29AgenciaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A29AgenciaId), 4, 0)));
         InitializeNonKey089( ) ;
      }

      protected void StandaloneModalInsert( )
      {
      }

      protected void define_styles( )
      {
         AddThemeStyleSheetFile("", context.GetTheme( )+".css", "?20412474");
         idxLst = 1 ;
         while ( idxLst <= Form.Jscriptsrc.Count )
         {
            context.AddJavascriptSource(StringUtil.RTrim( Form.Jscriptsrc.Item(idxLst)), "?20129323223266");
            idxLst = (int)(idxLst+1) ;
         }
         /* End function define_styles */
      }

      protected void include_jscripts( )
      {
         context.AddJavascriptSource("messages.spa.js", "?"+context.GetBuildNumber( 58381));
         context.AddJavascriptSource("agencia.js", "?20129323223266");
         /* End function include_jscripts */
      }

      protected void init_default_properties( )
      {
         imgBtn_first_Internalname = "BTN_FIRST" ;
         imgBtn_first_separator_Internalname = "BTN_FIRST_SEPARATOR" ;
         imgBtn_previous_Internalname = "BTN_PREVIOUS" ;
         imgBtn_previous_separator_Internalname = "BTN_PREVIOUS_SEPARATOR" ;
         imgBtn_next_Internalname = "BTN_NEXT" ;
         imgBtn_next_separator_Internalname = "BTN_NEXT_SEPARATOR" ;
         imgBtn_last_Internalname = "BTN_LAST" ;
         imgBtn_last_separator_Internalname = "BTN_LAST_SEPARATOR" ;
         imgBtn_select_Internalname = "BTN_SELECT" ;
         imgBtn_select_separator_Internalname = "BTN_SELECT_SEPARATOR" ;
         imgBtn_enter2_Internalname = "BTN_ENTER2" ;
         imgBtn_enter2_separator_Internalname = "BTN_ENTER2_SEPARATOR" ;
         imgBtn_cancel2_Internalname = "BTN_CANCEL2" ;
         imgBtn_cancel2_separator_Internalname = "BTN_CANCEL2_SEPARATOR" ;
         imgBtn_delete2_Internalname = "BTN_DELETE2" ;
         imgBtn_delete2_separator_Internalname = "BTN_DELETE2_SEPARATOR" ;
         divSectiontoolbar_Internalname = "SECTIONTOOLBAR" ;
         tblTabletoolbar_Internalname = "TABLETOOLBAR" ;
         lblTextblockagenciaid_Internalname = "TEXTBLOCKAGENCIAID" ;
         edtAgenciaId_Internalname = "AGENCIAID" ;
         lblTextblockagencianombre_Internalname = "TEXTBLOCKAGENCIANOMBRE" ;
         edtAgenciaNombre_Internalname = "AGENCIANOMBRE" ;
         lblTextblockagencialogo_Internalname = "TEXTBLOCKAGENCIALOGO" ;
         edtAgenciaLogo_Internalname = "AGENCIALOGO" ;
         lblTextblockpaisid_Internalname = "TEXTBLOCKPAISID" ;
         edtPaisId_Internalname = "PAISID" ;
         lblTextblockpaisnombre_Internalname = "TEXTBLOCKPAISNOMBRE" ;
         edtPaisNombre_Internalname = "PAISNOMBRE" ;
         tblTable2_Internalname = "TABLE2" ;
         bttBtn_enter_Internalname = "BTN_ENTER" ;
         bttBtn_cancel_Internalname = "BTN_CANCEL" ;
         bttBtn_delete_Internalname = "BTN_DELETE" ;
         tblTable1_Internalname = "TABLE1" ;
         grpGroupdata_Internalname = "GROUPDATA" ;
         tblTablemain_Internalname = "TABLEMAIN" ;
         Form.Internalname = "FORM" ;
         imgprompt_1_Internalname = "PROMPT_1" ;
      }

      public override void initialize_properties( )
      {
         init_default_properties( ) ;
         edtAgenciaLogo_Filename = "" ;
         Form.Headerrawhtml = "" ;
         Form.Background = "" ;
         Form.Backcolor = (int)(0xFFFFFF) ;
         Form.Caption = "Agencia" ;
         imgBtn_delete2_separator_Visible = 1 ;
         imgBtn_delete2_Enabled = 1 ;
         imgBtn_delete2_Visible = 1 ;
         imgBtn_cancel2_separator_Visible = 1 ;
         imgBtn_cancel2_Visible = 1 ;
         imgBtn_enter2_separator_Visible = 1 ;
         imgBtn_enter2_Enabled = 1 ;
         imgBtn_enter2_Visible = 1 ;
         imgBtn_select_separator_Visible = 1 ;
         imgBtn_select_Visible = 1 ;
         imgBtn_last_separator_Visible = 1 ;
         imgBtn_last_Visible = 1 ;
         imgBtn_next_separator_Visible = 1 ;
         imgBtn_next_Visible = 1 ;
         imgBtn_previous_separator_Visible = 1 ;
         imgBtn_previous_Visible = 1 ;
         imgBtn_first_separator_Visible = 1 ;
         imgBtn_first_Visible = 1 ;
         edtPaisNombre_Jsonclick = "" ;
         edtPaisNombre_Enabled = 0 ;
         imgprompt_1_Visible = 1 ;
         imgprompt_1_Link = "" ;
         edtPaisId_Jsonclick = "" ;
         edtPaisId_Enabled = 1 ;
         edtAgenciaLogo_Jsonclick = "" ;
         edtAgenciaLogo_Parameters = "" ;
         edtAgenciaLogo_Contenttype = "" ;
         edtAgenciaLogo_Filetype = "" ;
         edtAgenciaLogo_Enabled = 1 ;
         edtAgenciaNombre_Jsonclick = "" ;
         edtAgenciaNombre_Enabled = 1 ;
         edtAgenciaId_Jsonclick = "" ;
         edtAgenciaId_Enabled = 0 ;
         bttBtn_delete_Visible = 1 ;
         bttBtn_cancel_Visible = 1 ;
         bttBtn_enter_Visible = 1 ;
         context.GX_msglist.DisplayMode = 1 ;
      }

      protected void dynload_actions( )
      {
         /* End function dynload_actions */
      }

      public void Valid_Paisid( short GX_Parm1 ,
                                String GX_Parm2 )
      {
         A1PaisId = GX_Parm1 ;
         A2PaisNombre = GX_Parm2 ;
         /* Using cursor T000816 */
         pr_default.execute(14, new Object[] {A1PaisId});
         if ( (pr_default.getStatus(14) == 101) )
         {
            AnyError1 = 1 ;
            GX_msglist.addItem("No existe 'Pais'.", "ForeignKeyNotFound", 1, "PAISID");
            AnyError = 1 ;
            GX_FocusControl = edtPaisId_Internalname ;
         }
         if ( AnyError1 == 0 )
         {
            A2PaisNombre = T000816_A2PaisNombre[0] ;
         }
         pr_default.close(14);
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
            A2PaisNombre = "" ;
         }
         isValidOutput.Add((Object)(StringUtil.RTrim( A2PaisNombre)));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json") ;
      }

      public void cleanup( )
      {
         flushBuffer();
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
      }

      protected void CloseOpenCursors( )
      {
         pr_default.close(16);
         pr_default.close(7);
         pr_default.close(6);
         pr_default.close(14);
      }

      public override void initialize( )
      {
         sPrefix = "" ;
         wcpOGx_mode = "" ;
         scmdbuf = "" ;
         gxfirstwebparm = "" ;
         gxfirstwebparm_bkp = "" ;
         PreviousTooltip = "" ;
         PreviousCaption = "" ;
         Form = new GXWebForm();
         GX_FocusControl = "" ;
         sStyleString = "" ;
         ClassString = "" ;
         StyleString = "" ;
         TempTags = "" ;
         bttBtn_enter_Jsonclick = "" ;
         bttBtn_cancel_Jsonclick = "" ;
         bttBtn_delete_Jsonclick = "" ;
         lblTextblockagenciaid_Jsonclick = "" ;
         lblTextblockagencianombre_Jsonclick = "" ;
         A30AgenciaNombre = "" ;
         lblTextblockagencialogo_Jsonclick = "" ;
         gxblobfileaux = new GxFile(context.GetPhysicalPath());
         A31AgenciaLogo = "" ;
         lblTextblockpaisid_Jsonclick = "" ;
         lblTextblockpaisnombre_Jsonclick = "" ;
         A2PaisNombre = "" ;
         imgBtn_first_Jsonclick = "" ;
         imgBtn_first_separator_Jsonclick = "" ;
         imgBtn_previous_Jsonclick = "" ;
         imgBtn_previous_separator_Jsonclick = "" ;
         imgBtn_next_Jsonclick = "" ;
         imgBtn_next_separator_Jsonclick = "" ;
         imgBtn_last_Jsonclick = "" ;
         imgBtn_last_separator_Jsonclick = "" ;
         imgBtn_select_Jsonclick = "" ;
         imgBtn_select_separator_Jsonclick = "" ;
         imgBtn_enter2_Jsonclick = "" ;
         imgBtn_enter2_separator_Jsonclick = "" ;
         imgBtn_cancel2_Jsonclick = "" ;
         imgBtn_cancel2_separator_Jsonclick = "" ;
         imgBtn_delete2_Jsonclick = "" ;
         imgBtn_delete2_separator_Jsonclick = "" ;
         Z30AgenciaNombre = "" ;
         AV15Pgmname = "" ;
         sMode9 = "" ;
         sEvt = "" ;
         EvtGridId = "" ;
         EvtRowId = "" ;
         sEvtType = "" ;
         AV10TrnContext = new SdtTransactionContext(context);
         AV11WebSession = new GxWebSession( context);
         AV13TrnContextAtt = new SdtTransactionContext_Attribute(context);
         Z31AgenciaLogo = "" ;
         Z2PaisNombre = "" ;
         T00084_A2PaisNombre = new String[] {""} ;
         T00085_A29AgenciaId = new short[1] ;
         T00085_A30AgenciaNombre = new String[] {""} ;
         T00085_A2PaisNombre = new String[] {""} ;
         T00085_A1PaisId = new short[1] ;
         T00085_A31AgenciaLogo = new String[] {""} ;
         T00086_A2PaisNombre = new String[] {""} ;
         T00087_A29AgenciaId = new short[1] ;
         T00083_A29AgenciaId = new short[1] ;
         T00083_A30AgenciaNombre = new String[] {""} ;
         T00083_A1PaisId = new short[1] ;
         T00083_A31AgenciaLogo = new String[] {""} ;
         T00088_A29AgenciaId = new short[1] ;
         T00089_A29AgenciaId = new short[1] ;
         T000810_A29AgenciaId = new short[1] ;
         T000810_A30AgenciaNombre = new String[] {""} ;
         T000810_A1PaisId = new short[1] ;
         T000810_A31AgenciaLogo = new String[] {""} ;
         T000812_A29AgenciaId = new short[1] ;
         T000816_A2PaisNombre = new String[] {""} ;
         T000817_A34NoticiaId = new short[1] ;
         T000818_A29AgenciaId = new short[1] ;
         sDynURL = "" ;
         FormProcess = "" ;
         isValidOutput = new GxUnknownObjectCollection();
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.agencia__default(),
            new Object[][] {
                new Object[] {
               T00082_A29AgenciaId, T00082_A30AgenciaNombre, T00082_A1PaisId, T00082_A31AgenciaLogo
               }
               , new Object[] {
               T00083_A29AgenciaId, T00083_A30AgenciaNombre, T00083_A1PaisId, T00083_A31AgenciaLogo
               }
               , new Object[] {
               T00084_A2PaisNombre
               }
               , new Object[] {
               T00085_A29AgenciaId, T00085_A30AgenciaNombre, T00085_A2PaisNombre, T00085_A1PaisId, T00085_A31AgenciaLogo
               }
               , new Object[] {
               T00086_A2PaisNombre
               }
               , new Object[] {
               T00087_A29AgenciaId
               }
               , new Object[] {
               T00088_A29AgenciaId
               }
               , new Object[] {
               T00089_A29AgenciaId
               }
               , new Object[] {
               T000810_A29AgenciaId, T000810_A30AgenciaNombre, T000810_A1PaisId, T000810_A31AgenciaLogo
               }
               , new Object[] {
               }
               , new Object[] {
               T000812_A29AgenciaId
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000816_A2PaisNombre
               }
               , new Object[] {
               T000817_A34NoticiaId
               }
               , new Object[] {
               T000818_A29AgenciaId
               }
            }
         );
         AV15Pgmname = "Agencia" ;
      }

      private short wcpOAV7AgenciaId ;
      private short GxWebError ;
      private short A1PaisId ;
      private short AV7AgenciaId ;
      private short IsConfirmed ;
      private short IsModified ;
      private short AnyError ;
      private short nKeyPressed ;
      private short initialized ;
      private short A29AgenciaId ;
      private short Z29AgenciaId ;
      private short Z1PaisId ;
      private short N1PaisId ;
      private short AV12Insert_PaisId ;
      private short RcdFound9 ;
      private short GX_JID ;
      private short Gx_BScreen ;
      private short gxajaxcallmode ;
      private short wbTemp ;
      private int trnEnded ;
      private int bttBtn_enter_Visible ;
      private int bttBtn_cancel_Visible ;
      private int bttBtn_delete_Visible ;
      private int edtAgenciaId_Enabled ;
      private int edtAgenciaNombre_Enabled ;
      private int edtAgenciaLogo_Enabled ;
      private int edtPaisId_Enabled ;
      private int imgprompt_1_Visible ;
      private int edtPaisNombre_Enabled ;
      private int imgBtn_first_Visible ;
      private int imgBtn_first_separator_Visible ;
      private int imgBtn_previous_Visible ;
      private int imgBtn_previous_separator_Visible ;
      private int imgBtn_next_Visible ;
      private int imgBtn_next_separator_Visible ;
      private int imgBtn_last_Visible ;
      private int imgBtn_last_separator_Visible ;
      private int imgBtn_select_Visible ;
      private int imgBtn_select_separator_Visible ;
      private int imgBtn_enter2_Visible ;
      private int imgBtn_enter2_Enabled ;
      private int imgBtn_enter2_separator_Visible ;
      private int imgBtn_cancel2_Visible ;
      private int imgBtn_cancel2_separator_Visible ;
      private int imgBtn_delete2_Visible ;
      private int imgBtn_delete2_Enabled ;
      private int imgBtn_delete2_separator_Visible ;
      private int AV16GXV1 ;
      private int AnyError1 ;
      private int idxLst ;
      private String sPrefix ;
      private String wcpOGx_mode ;
      private String scmdbuf ;
      private String gxfirstwebparm ;
      private String gxfirstwebparm_bkp ;
      private String Gx_mode ;
      private String PreviousTooltip ;
      private String PreviousCaption ;
      private String GX_FocusControl ;
      private String edtAgenciaNombre_Internalname ;
      private String sStyleString ;
      private String tblTablemain_Internalname ;
      private String ClassString ;
      private String StyleString ;
      private String grpGroupdata_Internalname ;
      private String tblTable1_Internalname ;
      private String TempTags ;
      private String bttBtn_enter_Internalname ;
      private String bttBtn_enter_Jsonclick ;
      private String bttBtn_cancel_Internalname ;
      private String bttBtn_cancel_Jsonclick ;
      private String bttBtn_delete_Internalname ;
      private String bttBtn_delete_Jsonclick ;
      private String tblTable2_Internalname ;
      private String lblTextblockagenciaid_Internalname ;
      private String lblTextblockagenciaid_Jsonclick ;
      private String edtAgenciaId_Internalname ;
      private String edtAgenciaId_Jsonclick ;
      private String lblTextblockagencianombre_Internalname ;
      private String lblTextblockagencianombre_Jsonclick ;
      private String edtAgenciaNombre_Jsonclick ;
      private String lblTextblockagencialogo_Internalname ;
      private String lblTextblockagencialogo_Jsonclick ;
      private String edtAgenciaLogo_Filetype ;
      private String edtAgenciaLogo_Internalname ;
      private String edtAgenciaLogo_Contenttype ;
      private String edtAgenciaLogo_Parameters ;
      private String edtAgenciaLogo_Jsonclick ;
      private String lblTextblockpaisid_Internalname ;
      private String lblTextblockpaisid_Jsonclick ;
      private String edtPaisId_Internalname ;
      private String edtPaisId_Jsonclick ;
      private String imgprompt_1_Internalname ;
      private String imgprompt_1_Link ;
      private String lblTextblockpaisnombre_Internalname ;
      private String lblTextblockpaisnombre_Jsonclick ;
      private String edtPaisNombre_Internalname ;
      private String edtPaisNombre_Jsonclick ;
      private String tblTabletoolbar_Internalname ;
      private String divSectiontoolbar_Internalname ;
      private String imgBtn_first_Internalname ;
      private String imgBtn_first_Jsonclick ;
      private String imgBtn_first_separator_Internalname ;
      private String imgBtn_first_separator_Jsonclick ;
      private String imgBtn_previous_Internalname ;
      private String imgBtn_previous_Jsonclick ;
      private String imgBtn_previous_separator_Internalname ;
      private String imgBtn_previous_separator_Jsonclick ;
      private String imgBtn_next_Internalname ;
      private String imgBtn_next_Jsonclick ;
      private String imgBtn_next_separator_Internalname ;
      private String imgBtn_next_separator_Jsonclick ;
      private String imgBtn_last_Internalname ;
      private String imgBtn_last_Jsonclick ;
      private String imgBtn_last_separator_Internalname ;
      private String imgBtn_last_separator_Jsonclick ;
      private String imgBtn_select_Internalname ;
      private String imgBtn_select_Jsonclick ;
      private String imgBtn_select_separator_Internalname ;
      private String imgBtn_select_separator_Jsonclick ;
      private String imgBtn_enter2_Internalname ;
      private String imgBtn_enter2_Jsonclick ;
      private String imgBtn_enter2_separator_Internalname ;
      private String imgBtn_enter2_separator_Jsonclick ;
      private String imgBtn_cancel2_Internalname ;
      private String imgBtn_cancel2_Jsonclick ;
      private String imgBtn_cancel2_separator_Internalname ;
      private String imgBtn_cancel2_separator_Jsonclick ;
      private String imgBtn_delete2_Internalname ;
      private String imgBtn_delete2_Jsonclick ;
      private String imgBtn_delete2_separator_Internalname ;
      private String imgBtn_delete2_separator_Jsonclick ;
      private String AV15Pgmname ;
      private String edtAgenciaLogo_Filename ;
      private String sMode9 ;
      private String sEvt ;
      private String EvtGridId ;
      private String EvtRowId ;
      private String sEvtType ;
      private String sDynURL ;
      private String FormProcess ;
      private bool entryPointCalled ;
      private bool wbErr ;
      private bool AV9IsAuthorized ;
      private bool returnInSub ;
      private String A30AgenciaNombre ;
      private String A2PaisNombre ;
      private String Z30AgenciaNombre ;
      private String Z2PaisNombre ;
      private String A31AgenciaLogo ;
      private String Z31AgenciaLogo ;
      private GxWebSession AV11WebSession ;
      private GxUnknownObjectCollection isValidOutput ;
      private GxFile gxblobfileaux ;
      private GXMasterPage MasterPageObj ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private String[] T00084_A2PaisNombre ;
      private short[] T00085_A29AgenciaId ;
      private String[] T00085_A30AgenciaNombre ;
      private String[] T00085_A2PaisNombre ;
      private short[] T00085_A1PaisId ;
      private String[] T00085_A31AgenciaLogo ;
      private String[] T00086_A2PaisNombre ;
      private short[] T00087_A29AgenciaId ;
      private short[] T00083_A29AgenciaId ;
      private String[] T00083_A30AgenciaNombre ;
      private short[] T00083_A1PaisId ;
      private String[] T00083_A31AgenciaLogo ;
      private short[] T00088_A29AgenciaId ;
      private short[] T00089_A29AgenciaId ;
      private short[] T000810_A29AgenciaId ;
      private String[] T000810_A30AgenciaNombre ;
      private short[] T000810_A1PaisId ;
      private String[] T000810_A31AgenciaLogo ;
      private short[] T000812_A29AgenciaId ;
      private String[] T000816_A2PaisNombre ;
      private short[] T000817_A34NoticiaId ;
      private short[] T000818_A29AgenciaId ;
      private short[] T00082_A29AgenciaId ;
      private String[] T00082_A30AgenciaNombre ;
      private short[] T00082_A1PaisId ;
      private String[] T00082_A31AgenciaLogo ;
      private GXWebForm Form ;
      private SdtTransactionContext AV10TrnContext ;
      private SdtTransactionContext_Attribute AV13TrnContextAtt ;
   }

   public class agencia__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
         ,new ForEachCursor(def[3])
         ,new ForEachCursor(def[4])
         ,new ForEachCursor(def[5])
         ,new ForEachCursor(def[6])
         ,new ForEachCursor(def[7])
         ,new ForEachCursor(def[8])
         ,new UpdateCursor(def[9])
         ,new ForEachCursor(def[10])
         ,new UpdateCursor(def[11])
         ,new UpdateCursor(def[12])
         ,new UpdateCursor(def[13])
         ,new ForEachCursor(def[14])
         ,new ForEachCursor(def[15])
         ,new ForEachCursor(def[16])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmT00082 ;
          prmT00082 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00085 ;
          prmT00085 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00084 ;
          prmT00084 = new Object[] {
          new Object[] {"@PaisId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00086 ;
          prmT00086 = new Object[] {
          new Object[] {"@PaisId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00087 ;
          prmT00087 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00083 ;
          prmT00083 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00088 ;
          prmT00088 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT00089 ;
          prmT00089 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000810 ;
          prmT000810 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000811 ;
          prmT000811 = new Object[] {
          new Object[] {"@AgenciaNombre",SqlDbType.VarChar,40,0} ,
          new Object[] {"@AgenciaLogo",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@PaisId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000812 ;
          prmT000812 = new Object[] {
          } ;
          Object[] prmT000813 ;
          prmT000813 = new Object[] {
          new Object[] {"@AgenciaNombre",SqlDbType.VarChar,40,0} ,
          new Object[] {"@PaisId",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000814 ;
          prmT000814 = new Object[] {
          new Object[] {"@AgenciaLogo",SqlDbType.VarBinary,1024,0} ,
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000815 ;
          prmT000815 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000817 ;
          prmT000817 = new Object[] {
          new Object[] {"@AgenciaId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmT000818 ;
          prmT000818 = new Object[] {
          } ;
          Object[] prmT000816 ;
          prmT000816 = new Object[] {
          new Object[] {"@PaisId",SqlDbType.SmallInt,4,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("T00082", "SELECT [AgenciaId], [AgenciaNombre], [PaisId], [AgenciaLogo] FROM [Agencia] WITH (UPDLOCK) WHERE [AgenciaId] = @AgenciaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00082,1,0,true,false )
             ,new CursorDef("T00083", "SELECT [AgenciaId], [AgenciaNombre], [PaisId], [AgenciaLogo] FROM [Agencia] WITH (NOLOCK) WHERE [AgenciaId] = @AgenciaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00083,1,0,true,false )
             ,new CursorDef("T00084", "SELECT [PaisNombre] FROM [Pais] WITH (NOLOCK) WHERE [PaisId] = @PaisId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00084,1,0,true,false )
             ,new CursorDef("T00085", "SELECT TM1.[AgenciaId], TM1.[AgenciaNombre], T2.[PaisNombre], TM1.[PaisId], TM1.[AgenciaLogo] FROM ([Agencia] TM1 WITH (NOLOCK) INNER JOIN [Pais] T2 WITH (NOLOCK) ON T2.[PaisId] = TM1.[PaisId]) WHERE TM1.[AgenciaId] = @AgenciaId ORDER BY TM1.[AgenciaId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT00085,100,0,true,false )
             ,new CursorDef("T00086", "SELECT [PaisNombre] FROM [Pais] WITH (NOLOCK) WHERE [PaisId] = @PaisId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00086,1,0,true,false )
             ,new CursorDef("T00087", "SELECT [AgenciaId] FROM [Agencia] WITH (NOLOCK) WHERE [AgenciaId] = @AgenciaId  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT00087,1,0,true,false )
             ,new CursorDef("T00088", "SELECT TOP 1 [AgenciaId] FROM [Agencia] WITH (NOLOCK) WHERE ( [AgenciaId] > @AgenciaId) ORDER BY [AgenciaId]  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT00088,1,0,true,true )
             ,new CursorDef("T00089", "SELECT TOP 1 [AgenciaId] FROM [Agencia] WITH (NOLOCK) WHERE ( [AgenciaId] < @AgenciaId) ORDER BY [AgenciaId] DESC  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT00089,1,0,true,true )
             ,new CursorDef("T000810", "SELECT [AgenciaId], [AgenciaNombre], [PaisId], [AgenciaLogo] FROM [Agencia] WITH (UPDLOCK) WHERE [AgenciaId] = @AgenciaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000810,1,0,true,false )
             ,new CursorDef("T000811", "INSERT INTO [Agencia] ([AgenciaNombre], [AgenciaLogo], [PaisId]) VALUES (@AgenciaNombre, @AgenciaLogo, @PaisId)", GxErrorMask.GX_NOMASK,prmT000811)
             ,new CursorDef("T000812", "SELECT Ident_Current('[Agencia]') ",true, GxErrorMask.GX_NOMASK, false, this,prmT000812,1,0,true,false )
             ,new CursorDef("T000813", "UPDATE [Agencia] SET [AgenciaNombre]=@AgenciaNombre, [PaisId]=@PaisId  WHERE [AgenciaId] = @AgenciaId", GxErrorMask.GX_NOMASK,prmT000813)
             ,new CursorDef("T000814", "UPDATE [Agencia] SET [AgenciaLogo]=@AgenciaLogo  WHERE [AgenciaId] = @AgenciaId", GxErrorMask.GX_NOMASK,prmT000814)
             ,new CursorDef("T000815", "DELETE FROM [Agencia]  WHERE [AgenciaId] = @AgenciaId", GxErrorMask.GX_NOMASK,prmT000815)
             ,new CursorDef("T000816", "SELECT [PaisNombre] FROM [Pais] WITH (NOLOCK) WHERE [PaisId] = @PaisId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000816,1,0,true,false )
             ,new CursorDef("T000817", "SELECT TOP 1 [NoticiaId] FROM [Noticia] WITH (NOLOCK) WHERE [AgenciaId] = @AgenciaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000817,1,0,true,true )
             ,new CursorDef("T000818", "SELECT [AgenciaId] FROM [Agencia] WITH (NOLOCK) ORDER BY [AgenciaId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000818,100,0,true,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getBLOBFile(4, "tmp", "") ;
                break;
             case 1 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getBLOBFile(4, "tmp", "") ;
                break;
             case 2 :
                ((String[]) buf[0])[0] = rslt.getVarchar(1) ;
                break;
             case 3 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getVarchar(3) ;
                ((short[]) buf[3])[0] = rslt.getShort(4) ;
                ((String[]) buf[4])[0] = rslt.getBLOBFile(5, "tmp", "") ;
                break;
             case 4 :
                ((String[]) buf[0])[0] = rslt.getVarchar(1) ;
                break;
             case 5 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
             case 6 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
             case 7 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
             case 8 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getBLOBFile(4, "tmp", "") ;
                break;
             case 10 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
             case 14 :
                ((String[]) buf[0])[0] = rslt.getVarchar(1) ;
                break;
             case 15 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
             case 16 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 1 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 2 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 3 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 4 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 5 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 6 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 7 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 8 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 9 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (short)parms[2]);
                break;
             case 11 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (short)parms[1]);
                stmt.SetParameter(3, (short)parms[2]);
                break;
             case 12 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (short)parms[1]);
                break;
             case 13 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 14 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 15 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
       }
    }

 }

}
